package com.situ.mall.common.vo;

import com.situ.mall.common.entity.Category;
import com.situ.mall.common.entity.Product;
import lombok.Data;

import java.math.BigDecimal;

//首页上，商品信息VO（那8个最新的）
@Data
public class IndexProductVO {
    private Integer id;
    private String imgPath;
    private String name;
    private String title;
    private BigDecimal price;

    public IndexProductVO(){}
    public IndexProductVO(Integer id, String imgPath, String name, String title, BigDecimal price){
        this.id = id;this.imgPath = imgPath;
        this.name = name;this.title = title;
        this.price = price;
    }
    public IndexProductVO(Product p){
        this.id = p.getId();
        this.imgPath=p.getFirstimg();
        System.out.println(p);
        this.name = p.getName();
        this.title = p.getIntroduce();
        this.price = p.getPrice();
    }
}
